import requests
requests.packages.urllib3.disable_warnings()

# 请求头
headers1 = {
    "Host":"cn.bing.com",
    "Connection":"keep-alive",
    "Content-Length":"453",
    "sec-ch-ua-platform":"Android",
    "ect":"4g",
    "sec-ch-ua":'"Not/A)Brand";v="8", "Chromium";v="128", "Google Chrome";v="128"',
    "sec-ch-ua-mobile":"?1",
    "User-Agent":"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
    "Content-Type":"text/plain",
    "Accept":"*/*",
    "Origin":"https://cn.bing.com",
    "X-Edge-Shopping-Flag":"1",
    "Sec-MS-GEC":"A3DB4E3768BFC00299F2CA2F97BD9390BB63E077E09A1F2E3276F74C76080904",
    "Sec-MS-GEC-Version":"1-133.0.3065.69",
    "X-Client-Data":"eyIxIjoiMCIsIjIiOiIwIiwiMyI6IjAiLCI0IjoiNjkxMDM2NzI0OTEzMTc0MjE0MyIsIjYiOiJzdGFibGUiLCI5IjoiZGVza3RvcCJ9",
    "Sec-Fetch-Site":"same-origin",
    "Sec-Fetch-Mode":"no-cors",
    "Sec-Fetch-Dest":"empty",
    "Referer":"https://cn.bing.com/?form=000047&ocid=msedgdhp&pc=EdgeStart&cvid=807b5f3d1e6448f8bbc1e78fe8e462cb&ei=7",
    "Accept-Encoding":"gzip, deflate, br, zstd",
    "Cookie":"ANON=A=D2D3B63BEBFE3F326908F030FFFFFFFF&E=1aa2&W=1; MUID=1BD16D59EF6E67FA08CF7F37EE4066AB; MUIDB=1BD16D59EF6E67FA08CF7F37EE4066AB; ABDEF=V=13&ABDV=13&MRNB=1714447239130&MRB=0; SRCHD=AF=ntptra; SRCHUID=V=2&GUID=9587EECEF067478CA84EFD3B0B5770AC&dmnchg=1; _UR=QS=0&TQS=0&Pn=0; GC=Jg_hb6I7qEPfiM2pm2hyAF4015bxhOiRlgMaXN7g7XJNhmfsd_g_ohSE_X4f9jl7e8UUTK9cyzhy-q3s4Z92aw; _RwBf=ilt=8&ihpd=0&ispd=1&rc=93&rb=93&gb=0&rg=0&pc=90&mtu=0&rbb=0.0&g=0&cid=&clo=0&v=8&l=2025-02-17T08:00:00.0000000Z&lft=0001-01-01T00:00:00.0000000&aof=0&o=0&p=MSAAUTOENROLL&c=MR000T&t=8402&s=2023-10-20T07:43:34.2089582+00:00&ts=2025-02-18T07:21:07.8077147+00:00&rwred=0&wls=0&lka=0&lkt=0&TH=&dci=0&mta=0&wlb=0&aad=0&e=krdv-ZkgPYh_SUcwQx5xL4bLDFDzu3dRxGfhEZVEEjbcqGx6yEYWOHe9NemntKfSC-OroCIkmg1vATU8tMZ2dCwlE35_aoLOK_R6ofZ1EOk&A=&ard=0001-01-01T00:00:00.0000000&rwdbt=-62135539200&wle=1&ccp=2&rwflt=1725314848&cpt=0&rwaul2=0; SRCHUSR=DOB=20221107&T=1739924184000; USRLOC=HS=1&ELOC=LAT=45.74073028564453|LON=126.56119537353516|N=%E9%81%93%E9%87%8C%E5%8C%BA%EF%BC%8C%E9%BB%91%E9%BE%99%E6%B1%9F%E7%9C%81|ELT=2|&CLOC=LAT=45.73599035029431|LON=126.56203681547476|A=733.4464586120832|TS=250219003002|SRC=W&BID=MjUwMjE5MDgyOTU5X2EzY2I1OWZjMmJkZDg0N2VlOTI3NjIzNjc2M2UzMjdiMjg3MTRkYzRhYmMxODcwNWUwODA0NzdkY2M2OWRlYTg=; _EDGE_S=SID=15A41E007FE36E711ADD0B987E316F50; _SS=PC=EdgeStart&SID=15A41E007FE36E711ADD0B987E316F50&OCID=msedgdhp; SRCHS=PC=EdgeStart; _HPVN=CS=eyJQbiI6eyJDbiI6NiwiU3QiOjAsIlFzIjowLCJQcm9kIjoiUCJ9LCJTYyI6eyJDbiI6NiwiU3QiOjAsIlFzIjowLCJQcm9kIjoiSCJ9LCJReiI6eyJDbiI6NiwiU3QiOjAsIlFzIjowLCJQcm9kIjoiVCJ9LCJBcCI6dHJ1ZSwiTXV0ZSI6dHJ1ZSwiTGFkIjoiMjAyNS0wMi0xOVQwMDowMDowMFoiLCJJb3RkIjowLCJHd2IiOjAsIlRucyI6MCwiRGZ0IjpudWxsLCJNdnMiOjAsIkZsdCI6MCwiSW1wIjo2MywiVG9ibiI6MH0=; SRCHHPGUSR=SRCHLANG=zh-Hans&PV=10.0.0&DM=0&BRW=MW&BRH=MT&CW=1178&CH=1204&SCW=1178&SCH=1204&DPR=1.1&UTC=480&BZA=0&PRVCW=1176&PRVCH=1199&EXLTT=3&HV=1739925017&WTS=63875520986&PR=1.1041666269302368",
    "Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
}

# 请求头
headers2 = {
    "Host":"cn.bing.com",
    "Connection":"keep-alive",
    "sec-ch-ua-platform":"Android",
    "ect":"4g",
    "sec-ch-ua":'"Not/A)Brand";v="8", "Chromium";v="128", "Google Chrome";v="128"',
    "sec-ch-ua-mobile":"?1",
    "User-Agent":"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
    "Accept":"*/*",
    "Origin":"https://cn.bing.com",
    "X-Edge-Shopping-Flag":"1",
    "Sec-MS-GEC":"A3DB4E3768BFC00299F2CA2F97BD9390BB63E077E09A1F2E3276F74C76080904",
    "Sec-MS-GEC-Version":"1-133.0.3065.69",
    "X-Client-Data":"eyIxIjoiMCIsIjIiOiIwIiwiMyI6IjAiLCI0IjoiNjkxMDM2NzI0OTEzMTc0MjE0MyIsIjYiOiJzdGFibGUiLCI5IjoiZGVza3RvcCJ9",
    "Sec-Fetch-Site":"same-origin",
    "Sec-Fetch-Mode":"no-cors",
    "Sec-Fetch-Dest":"empty",
    "Referer":"https://cn.bing.com/policy/match?tpl_idx=0",
    "Accept-Encoding":"gzip, deflate, br, zstd",
    "Cookie": "ANON=A=D2D3B63BEBFE3F326908F030FFFFFFFF&E=1aa2&W=1; MUID=1BD16D59EF6E67FA08CF7F37EE4066AB; MUIDB=1BD16D59EF6E67FA08CF7F37EE4066AB; ABDEF=V=13&ABDV=13&MRNB=1714447239130&MRB=0; SRCHD=AF=ntptra; SRCHUID=V=2&GUID=9587EECEF067478CA84EFD3B0B5770AC&dmnchg=1; _UR=QS=0&TQS=0&Pn=0; GC=Jg_hb6I7qEPfiM2pm2hyAF4015bxhOiRlgMaXN7g7XJNhmfsd_g_ohSE_X4f9jl7e8UUTK9cyzhy-q3s4Z92aw; _RwBf=ilt=8&ihpd=0&ispd=1&rc=93&rb=93&gb=0&rg=0&pc=90&mtu=0&rbb=0.0&g=0&cid=&clo=0&v=8&l=2025-02-17T08:00:00.0000000Z&lft=0001-01-01T00:00:00.0000000&aof=0&o=0&p=MSAAUTOENROLL&c=MR000T&t=8402&s=2023-10-20T07:43:34.2089582+00:00&ts=2025-02-18T07:21:07.8077147+00:00&rwred=0&wls=0&lka=0&lkt=0&TH=&dci=0&mta=0&wlb=0&aad=0&e=krdv-ZkgPYh_SUcwQx5xL4bLDFDzu3dRxGfhEZVEEjbcqGx6yEYWOHe9NemntKfSC-OroCIkmg1vATU8tMZ2dCwlE35_aoLOK_R6ofZ1EOk&A=&ard=0001-01-01T00:00:00.0000000&rwdbt=-62135539200&wle=1&ccp=2&rwflt=1725314848&cpt=0&rwaul2=0; SRCHUSR=DOB=20221107&T=1739924184000; USRLOC=HS=1&ELOC=LAT=45.74073028564453|LON=126.56119537353516|N=%E9%81%93%E9%87%8C%E5%8C%BA%EF%BC%8C%E9%BB%91%E9%BE%99%E6%B1%9F%E7%9C%81|ELT=2|&CLOC=LAT=45.73599035029431|LON=126.56203681547476|A=733.4464586120832|TS=250219003002|SRC=W&BID=MjUwMjE5MDgyOTU5X2EzY2I1OWZjMmJkZDg0N2VlOTI3NjIzNjc2M2UzMjdiMjg3MTRkYzRhYmMxODcwNWUwODA0NzdkY2M2OWRlYTg=; _EDGE_S=SID=15A41E007FE36E711ADD0B987E316F50; _SS=PC=EdgeStart&SID=15A41E007FE36E711ADD0B987E316F50&OCID=msedgdhp; SRCHS=PC=EdgeStart; _HPVN=CS=eyJQbiI6eyJDbiI6NiwiU3QiOjAsIlFzIjowLCJQcm9kIjoiUCJ9LCJTYyI6eyJDbiI6NiwiU3QiOjAsIlFzIjowLCJQcm9kIjoiSCJ9LCJReiI6eyJDbiI6NiwiU3QiOjAsIlFzIjowLCJQcm9kIjoiVCJ9LCJBcCI6dHJ1ZSwiTXV0ZSI6dHJ1ZSwiTGFkIjoiMjAyNS0wMi0xOVQwMDowMDowMFoiLCJJb3RkIjowLCJHd2IiOjAsIlRucyI6MCwiRGZ0IjpudWxsLCJNdnMiOjAsIkZsdCI6MCwiSW1wIjo2MywiVG9ibiI6MH0=; SRCHHPGUSR=SRCHLANG=zh-Hans&PV=10.0.0&DM=0&BRW=MW&BRH=MT&CW=1178&CH=1204&SCW=1178&SCH=1204&DPR=1.1&UTC=480&BZA=0&PRVCW=1176&PRVCH=1199&EXLTT=3&HV=1739925017&WTS=63875520986&PR=1.1041666269302368",
    "Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
}

url = "http://www.baidu.com"
response = requests.post(url,  verify=False)
print(f" contains {response.text}");
target_string = response.text;
search_string ='正在入网检查';

if search_string in target_string:
    print(f" contains {search_string}")

    url1 = "http://cn.bing.com/match?tpl_idx=0"
    # 请求体
    datas = '<ClientInstRequest><Events><E><T>Event.ClientInst</T><IG>EF6DC8B69B914487A4C677A7170CC78B</IG><TS>1739925755598</TS><D><![CDATA[[{"T":"CI.BoxModel","FID":"CI","Name":"v2.8.3","P":{"C":2,"N":17,"I":"2cb","S":"V","M":"V+L+M+MT+E+N+C+K+BD+BF","T":738982,"K":"fu79","F":1},"V":"@24/////////@w/visibilitychange","M":"k4+nt+-1+fu7a+3q+0+0+0+0+6l3+1","N":"@24/3p//@2/@w//0/@4/-1/-1/-1/-1/-1/-1"}]]]></D></E></Events><STS>1739925755598</STS></ClientInstRequest>';
    # 发送请求
    response1 = requests.post(url1, data=datas, headers=headers1, verify=False)
    # 打印响应内容
    print(response1.text)

    url2 = "http://cn.bing.com/api/auth/page?tpl_idx=0&random=90454"
    # 发送请求
    response2 = requests.get(url2, headers=headers2, verify=False)
    # 打印响应内容
    print(response2.text)

    url3 = "http://cn.bing.com/api/policy/match?&random=67129"
    # 发送请求
    response3 = requests.get(url3, headers=headers2, verify=False)
    # 打印响应内容
    print(response3.text)


else:
    print(f"does not contain {search_string}")


